--DELETE FROM mail_sentmessage
INSERT INTO mail_sentmessage
SELECT top 100
newid() AS [Id],case len(convert(varchar(10),comid))
    when 5 then '00000000-0000-0000-0000-0000000' + convert(varchar(10),comid) 
    when 4 then '00000000-0000-0000-0000-00000000' + convert(varchar(10),comid) 
    when 3 then '00000000-0000-0000-0000-000000000' + convert(varchar(10),comid) 
    when 2 then '00000000-0000-0000-0000-0000000000' + convert(varchar(10),comid) 
    when 1 then '00000000-0000-0000-0000-00000000000'+ convert(varchar(10),comid) 
    end AS  [From],'00000000-0000-0000-0000-00000' + convert(varchar(7),userid) AS [To],substring(letterdetail,0,30) AS [Subject],letterdetail AS [Body],CreatedDate AS [DateSent],Case intervReturnwhen 3 then 1when 4 then 2 end AS [Status],CreatedDate AS [DateCreated],0 AS [RequestReceipt]FROM srv_lnk.nchr2008.dbo.MyInterview
where userid <> 0 AND CREATEDDATE >'2012-1-1'
--SELECT TOP 10 * FROM srv_lnk.nchr2008.dbo.MyInterview